package org.atlantis.ymer.command;

public enum CommandType {
	NONE(-1), CONNECT(1), DISCONNECT(2), PING(3), PONG(4), PUB(5);
	private int value;

	private CommandType(int value) {
		this.value = value;
	}

	public int getValue() {
		return value;
	}

	public static CommandType of(int value) {
		switch (value) {
		case 1:
			return CONNECT;
		case 2:
			return DISCONNECT;
		case 3:
			return PING;
		case 4:
			return PONG;
		case 5:
			return PUB;
		default:
			return NONE;
		}
	}
}
